<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class NodeLike extends Model
{
    public $timestamps = false;
    protected $connection = 'xz';
    protected $table = 'node_like';
    use HasFactory;

    /**
     *  获取日期.
     *
     * @param string $value
     * @return string
     */
    public function getCreateTimeAttribute(string $value)
    {
        return Date("Y-m-d H:i:s",$value);
    }

    public function node()
    {
        return $this->hasOne('App\Models\Node','id','nid');
    }
}
